HoS_PRC8/_mod/_module/nss/djinn_wish.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

72 lines
2.5 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// Djinn Wish
// By Deva Bryson Winblood. 02/07/2004
////////////////////////////////////////////////////////////////////////////////
#include "rtsh_multiplay"
void main()
{
object oPC=GetPCSpeaker();
object oDjinn=OBJECT_SELF;
int nParm=GetLocalInt(oPC,"nDjinn");
object oItem;
object oDest;
string sID=GetLocalString(oPC,"sTeamID");
int nN;
SetLocalInt(oDjinn,"nGranted",TRUE); // Wish has been granted
switch(nParm)
{ // Djinn Wish Switch
case 1: { // back to lair
oDest=GetWaypointByTag(sID+"_START");
AssignCommand(oPC,ClearAllActions(TRUE));
AssignCommand(oPC,JumpToObject(oDest));
DelayCommand(5.0,DestroyObject(oDjinn));
break;
} // back to lair
case 2: { // wealth
GiveGoldToCreature(oPC,2500);
DelayCommand(HoursToSeconds(6),AssignCommand(oPC,TakeGoldFromCreature(2500,oPC,TRUE)));
DelayCommand(30.0,DestroyObject(oDjinn));
break;
} // wealth
case 3: { // power
nN=fnGetTeamMana(oPC);
nN=nN+100;
SendMessageToPC(oPC,"Your team receives 100 mana.");
fnSetTeamMana(oPC,nN);
DelayCommand(30.0,DestroyObject(oDjinn));
break;
} // power
case 4: { // Serve me
AssignCommand(oDjinn,SpeakString("I will serve you for 6 hours."));
SetLocalString(oDjinn,"sTeamID",sID);
DelayCommand(HoursToSeconds(6),SpeakString("Farewell."));
DelayCommand(HoursToSeconds(6)+10.0,DestroyObject(oDjinn));
oDest=GetWaypointByTag(sID+"_RESOURCES");
oItem=GetObjectByTag(sID+"_PROXY");
ChangeFaction(oDjinn,oItem);
break;
} // Serve me
case 5: { // city
oDest=GetWaypointByTag("DJINN_CITY");
AssignCommand(oPC,ClearAllActions(TRUE));
AssignCommand(oPC,JumpToObject(oDest));
DelayCommand(5.0,DestroyObject(oDjinn));
break;
} // city
case 6: { // elben
oDest=GetWaypointByTag("DJINN_ELBEN");
AssignCommand(oPC,ClearAllActions(TRUE));
AssignCommand(oPC,JumpToObject(oDest));
DelayCommand(5.0,DestroyObject(oDjinn));
break;
} // elben
case 7: { // astral
oDest=GetWaypointByTag("DJINN_ASTRAL");
AssignCommand(oPC,ClearAllActions(TRUE));
AssignCommand(oPC,JumpToObject(oDest));
DelayCommand(5.0,DestroyObject(oDjinn));
break;
} // astral
} // Djinn Wish Switch
}