How to add key items to mob_droplist

Post Reply
Wannabc5
Posts: 25
Joined: Tue Feb 24, 2015 8:28 am

How to add key items to mob_droplist

Post by Wannabc5 » Mon Sep 14, 2015 11:46 am

How do I add key items to mob_droplist?

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: How to add key items to mob_droplist

Post by demolish » Mon Sep 14, 2015 12:37 pm

mob_droplist is for items
if you wanted to add keyitems you'd have to do it in the mob's script in onMobDeath
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Wannabc5
Posts: 25
Joined: Tue Feb 24, 2015 8:28 am

Re: How to add key items to mob_droplist

Post by Wannabc5 » Tue Sep 15, 2015 9:02 am

Is this correct?



-----------------------------------
-- onMobDeath
-----------------------------------

function onMobDeath(mob,killer)

if (killer:hasKeyItem(WARPED_GIGAS_ARMBAND) == false) then
killer:addKeyItem(WARPED_GIGAS_ARMBAND);
killer:messageSpecial(WARPED_GIGAS_ARMBAND);
end

end;

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: How to add key items to mob_droplist

Post by demolish » Tue Sep 15, 2015 11:00 am

almost, make sure to require the globals where the vars are defined
oh and messsageSpecial takes more than one param: message/text id and param (e.g. messageSpecial(KEYITEM_OBTAINED, KEYITEM_ID)
(keyitems are scripts/globals/keyitems, messages/text ids are scripts/zones/ZONE_NAME/TextIDs, other shit is usually scripts/globals/status)

oh and indent cause non-indented code is ewww
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Post Reply