Page 1 of 1

addspell via NPC

Posted: Wed Feb 19, 2014 12:30 am
by Gratis
Our server has a few perk NPC's and one of them gives out certain key items, trying to add certain spells to that NPC as well but it seems to not be working. Any pointers? I added the player:addspell portion to the NPC but it is not giving out the spells to characters...


-----------------------------------
-- Area: Upper Jeuno
-- NPC: Bheem
-- Standard Info NPC
-----------------------------------

package.loaded["scripts/zones/Upper_Jeuno/TextIDs"] = nil;
require("scripts/zones/Upper_Jeuno/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
player:startEvent(0x009D);
if(player:hasCompletedMission(ZILART,THE_NEW_FRONTIER) == false) then
player:addMission(3,0);
end
if(player:getVar("Initial_Bonus") ~= 1 and player:getMainLvl() > 1 and player:getSubJob() ~= 0 and player:getRank() ~= 1) then
player:completeQuest(SANDORIA,A_KNIGHT_S_TEST);
player:completeQuest(BASTOK,BLADE_OF_DARKNESS);
player:completeQuest(JEUNO,PATH_OF_THE_BEASTMASTER);
player:completeQuest(JEUNO,PATH_OF_THE_BARD);
player:completeQuest(WINDURST,THE_FANGED_ONE);
player:completeQuest(OUTLANDS,FORGE_YOUR_DESTINY);
player:completeQuest(BASTOK,AYAME_AND_KAEDE);
player:completeQuest(SANDORIA,THE_HOLY_CREST);
player:completeQuest(WINDURST,I_CAN_HEAR_A_RAINBOW);
player:addKeyItem(VIAL_OF_SHROUDED_SAND);
player:addKeyItem(PSC_WILDCAT_BADGE);
player:addKeyItem(AIRSHIP_PASS);
player:addKeyItem(AIRSHIP_PASS_FOR_KAZHAM);
player:addKeyItem(HOLLA_GATE_CRYSTAL);
player:addKeyItem(DEM_GATE_CRYSTAL);
player:addKeyItem(MEA_GATE_CRYSTAL);
player:addKeyItem(VAHZL_GATE_CRYSTAL);
player:addKeyItem(YHOATOR_GATE_CRYSTAL);
player:addKeyItem(ALTEPA_GATE_CRYSTAL);
player:addKeyItem(CERULEAN_CRYSTAL);
player:addKeyItem(LIGHT_OF_ALTAIEU);
player:addKeyItem(CHOCOBO_LICENSE);
player:addspell(BREAKGA);
player:addspell(BLIZZAJA);
player:addspell(BLIZZAGA_IV);
player:addspell(BLIZZAGA_V);
player:addspell(THUNDER_V);
player:addspell(THUNDAJA);
player:addspell(BLIZZAGA_IV);
player:addspell(GRAVITY_II);
player:addspell(FENRIR);
player:addspell(DIABOLOS);
player:addspell(THUNDAGA_IV);
player:addspell(THUNDAGA_V);
player:addFame(0,2500);
player:addFame(1,2500);
player:addFame(2,2500);
player:addFame(5,2500);
player:setRank(10);
player:levelCap(99);
player:setVar("Initial_Bonus",1);
end
if(player:getRank() < 10) then
player:setRank(10);
end

end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;

Re: addspell via NPC

Posted: Wed Feb 19, 2014 12:14 pm
by deviltti
addSpell versus addspell.

Re: addspell via NPC

Posted: Wed Feb 19, 2014 9:27 pm
by Gratis
Did not work... orz. ; ;

Re: addspell via NPC

Posted: Thu Feb 20, 2014 2:58 am
by demolish
require("scripts/globals/status");

Re: addspell via NPC

Posted: Thu Feb 20, 2014 11:48 am
by deviltti
You will also need to require keyitems, quests, missions and make aliases for the spell names.

Re: addspell via NPC

Posted: Sun May 11, 2014 11:13 am
by Signature
instead of Typing out the spell Name use this method

player:addSpell(217); --Gravity II

use this list of SpellId's https://wiki.dspt.info/index.php/Spell_IDs