I suppose i can start you off
Code:
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305)
#endif
class GOSCRIPT : public GameObjectAIScript
{
public:
GOSCRIPT(GameObject* goinstance) : GameObjectAIScript(goinstance) {}
static GameObjectAIScript *Create(GameObject * GO) { return new GOSCRIPT(GO); }
void OnActivate(Player * Plr, GameObject *GO)
{
if (Plr->GetItemInterface()->GetItemCount(KEYID,false)==1)
{
// Code to open door here
}else{
Plr->BroadcastMessage("HAHAHAHAHHA NO");
}
}
};
void SetupGOSCRIPT(ScriptMgr *mgr)
{
mgr->register_gameobject_script(GOENTRYID, &GOSCRIPT::Create);
}