• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[CreatureScript] When certain monster dies, player gets a reward?

Kombosabo

New Member
Joined
Jul 30, 2009
Messages
27
Reaction score
1
What I want is really simple:

The player kills a Grim Reaper for the first time and gets a 1 Boots of Haste and 1 Blue Robe,
and also gets a orange message:

doCreatureSay(cid, "Congratulations, you killed a Grim Reaper. You receive Boots of Haste and a Blue Robe as a reward.", TALKTYPE_ORANGE_1, cid)

if he kills more Grim Reaper, he won't get more rewards or messages, JUST for the first Grim Reaper that he kills.

And also if he kills a Serpent Spawn for the first time, he gets 50 Small Emeralds, only once of course.

doCreatureSay(cid, "You have destroyed the Serpent Spawn. Receive 50 small emeralds as a reward.", TALKTYPE_ORANGE_1, cid)

I am not really good with scripts, can someone help me?
Would be great.

Thanks :)
 
Just set a storage ID before killing the monster and after change that storage ID using onKill function. Should work, I'm too lazy to try today.
 
I'm extremely newbie with scripts, can you just explain how to do that?
Well first of all, is the first script going to be an event or just a regular Grim Reaper?
If it's an event then it's easy, elseway well then it's kind of tricky.
 
Well first of all, is the first script going to be an event or just a regular Grim Reaper?

Just a normal grim reaper.

Like, if the player was gonna hunt grim reaper, the first one that he kills he gets a boots of haste and a blue robe.

Edit 1:
2195 <- Boots of haste
2656 <- Blue Robe
2149 <- Small emerald

Edit 2:
I was gonna make the grim reaper as a single spawn, as if he was a boss, if you get me...
and when the player kills the boss he gets special items from that boss.
But I don't want to player to get it many times, just once.

Dunno how to do that ...
:p
 
Lua:
function onKill(cid, target, lastHit)
local v = getPlayerStorageValue(cid,storage) == 1
if isPlayer(v) then
   if isMonster(target) then
      if getCreatureName(target) == 'Grim Reaper' then
         doPlayerAddItem(cid, 2195, 1)
         doPlayerAddItem(cid, 2656, 1)
         doPlayerAddItem(cid, 2149, 1)
         setPlayerStorageValue(v, storage, 2)
      end
   end
end
return true
end
Credits to barker (IRC).
Add it in a creaturescript.
 
Lua:
function onKill(cid, target, lastHit)
local v = getPlayerStorageValue(cid,storage) == 1
if isPlayer(v) then
   if isMonster(target) then
      if getCreatureName(target) == 'Grim Reaper' then
         doPlayerAddItem(cid, 2195, 1)
         doPlayerAddItem(cid, 2656, 1)
         doPlayerAddItem(cid, 2149, 1)
         setPlayerStorageValue(v, storage, 2)
      end
   end
end
return true
end
Credits to barker (IRC).
Add it in a creaturescript.

Thank you!
I'm gonna test and post here the result! :)

EDIT:

Is there anything else I need to do? or just add it to creature scripts? ._.

<event type="bossreward" name="bossreward" event="script" value="bossreward.lua"/>

is that all?

._.
 
Nevermind this, I gave up and decided to make it like a quest XD
I'm gonna edit pythius the rotten script, It should work similarly.

Thanks a lot! :w00t:
 
Yep, I did that :p
nothing tho. I just figured out that making it like pyrius the rotten is a lot better for me and my OT
thanks :p

REP+
 
Back
Top