Jump to content

[LE] What is wrong with my script ? :)


Recommended Posts

//Edit:

 

 

  Reveal hidden contents

Final Final version:
  Reveal hidden contents
Scriptname QLG_Script_DeleteDead extends Actor
;===- Base Info. -===;
 ;Created: 2019-03-09
 ;Update: 2019-03-12 ( TobiPL )
 ;Author: TobiPL
 ;Unit: M.PC<3>
;===- Var. setup -============================================


;===- Fame -===
	GlobalVariable property QFameStore auto
	{ Global, Fame that player have }
	
	int property QFameReward auto
	{ Fame that player earn for killing this enemy }
	
	
;===- Gold -===
	GlobalVariable property QArenaPayout auto
	{ Global, Gold that player should get after win }
	
	int property QGoldChance auto
	{ Chance to drop gold }
	
	int property QGoldReward auto
	{ Gold that player earn for killing this enemy }
	
	int property QGoldOff auto
	{ Gold offset for killing Monsters
		example:
		  Set =20= mean +/- 10 Gold
		  Set =60= mean +/- 30 Gold
		This value shouldn't be bigger than QGoldReward
	}
	

;===- Messages -===	
	bool property QIsBoss auto
	{ Only if Unit is Boss or Special }
	
	string property QKillMsg auto
	{ Text to show when player have killed this unit 
	  Text will show only if :QIsBoss: is set to True }





;===- Script -Main- -================================================
Event OnDeath(Actor QKiller)

	If ( QKiller == Game.GetPlayer() )
		If QIsBoss
			Debug.Notification( QKillMsg )
		EndIf
		
		If ( QGoldChance > Utility.RandomInt(0, 100) )
		
			int QPay = QGoldOff / 2
			QPay = Utility.RandomInt( -QPay, QPay ) + QGoldReward
			
			If ( QPay > 0 )
				QArenaPayout.Mod( QPay as int )
			EndIf
		EndIf
		
		QFameStore.Mod( QFameReward )
		
		Utility.Wait(30.0)		;wait for other mods/scripts
		self.disable()			;disable
		Utility.Wait(10.0)		;wait
		self.delete()			;delete
	EndIf
EndEvent


;===- Script -===-===- ;ReDragon2013 ( NexusForum )
Event OnCellDetach()
	
	self.Delete()            ;just in case (have to be verified)
	
EndEvent






 

 

Edited by TobiaszPL
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...