- Joined
- Dec 23, 2008
- Messages
- 55
- Reaction score
- 7
Ok first off:
THIS IS A TITAN SOURCE SCRIPT, NOT AN ODIN SOURCE SCRIPT MEANING IT IS C++ PROGRAMMING.
Overview::
A player will double click an NPC and then it will ask: "Are you gay?"; if the player says "NO" then it will not let them leave the conversation, but if they say yes; a red notice at the bottom says: <player who clicked "YES"> admitted to being gay. Then the conversation will be over.
Lets get started! *NOTE* Replace <NPC ID> with the ID of the NPC that will prank people
Ok, create a new file called: PrankNPC.cpp
Next copy this code into your new file (PrankNPC.cpp)
Now goto NPCsScripts.cpp and find the line:
Underneath that write:
Now find the line:
Underneath that write:
If you have any questions or comments please post them here.
THIS IS A TITAN SOURCE SCRIPT, NOT AN ODIN SOURCE SCRIPT MEANING IT IS C++ PROGRAMMING.
Overview::
A player will double click an NPC and then it will ask: "Are you gay?"; if the player says "NO" then it will not let them leave the conversation, but if they say yes; a red notice at the bottom says: <player who clicked "YES"> admitted to being gay. Then the conversation will be over.
Lets get started! *NOTE* Replace <NPC ID> with the ID of the NPC that will prank people
Ok, create a new file called: PrankNPC.cpp
Next copy this code into your new file (PrankNPC.cpp)
PHP:
#include "NPCs.h"
#include "NPCsScripts.h"
#include "Player.h"
#include "PlayersPacket.h"
void NPCsScripts::<NPC ID>(NPC* npc) {
Player* player = npc->getPlayer();
int state = npc->getState();
if (state == 0) {
npc->addText("Are you gay?");
npc->sendYesNo();
}
else {
npc->addText("You can't leave this chat then...");
npc->sendOK();
int state = npc->getState();
}
}
else if (state == 1) {
if(npc->getSelected() == YES){
npc->getPlayer()->getName();
PlayersPacket::showMassage(%s admitted to being gay, 5);
npc->end()
}
PHP:
case 2030000: npc_2030000(npc); break;
PHP:
case <NPC ID>: npc_<NPC ID>(npc); break;
PHP:
static void npc_2030000(NPC* npc);
PHP:
static void npc_<NPC ID>(NPC* npc);
If you have any questions or comments please post them here.