[7.6] Criando Um Teleport

frerety

DVNO
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 08/04/06Posts: 133

HiHo!

Entrega de pedido de favorefty;

Tópico original: Quero Essa Cod., entre por

favor.

Criando uma nova função para actions

Actions.cpp

Procure por:

lua_register(luaState, "doPlayerRemoveItem", ActionScript::luaActionDoPlayerRemoveItem);

adicione logo após:

 

int ActionScript::luacreateTeleport(lua_State *L){	PositionEx pos1, pos2;	internalGetPositionEx(L,pos1);	internalGetPositionEx(L,pos2);	ActionScript *action = getActionScript(L);    Teleport* tp = new Teleport(1387);    tp->setDestPos((Position&)pos1);	action->game->addThing(NULL,(Position)pos2,tp);	return 1;}

 

Actions.h

Procure por:

static int luaActionSetPlayerStorageValue(lua_State *L);

logo abaixo adicione:

 

bool Commands::cTeleport(Creature* c, const std::string &cmd, const std::string &param){    std::istringstream in(param.c_str());    Position pos;    in >> pos.x >> pos.y >> pos.z;    Teleport* tp = new Teleport(1387);    tp->setDestPos(pos);    game->addThing(NULL,c->pos,tp);    return true;}

 

Commands.h

Procure por:

bool kickPlayer(Creature* c, const std::string &cmd, const std::string &param);

logo abaixo adicione:

 

function onUse(cid, item, frompos, item2, topos)[b]criaronde[/b] = {[b]x[/b]=[b]160[/b], [b]y[/b]=[b]55[/b], [b]z[/b]=[b]7[/b], stackpos=1} -- onde o teleport será criado[b]irpara[/b] = {[b]x[/b]=[b]160[/b], [b]y[/b]=[b]54[/b], [b]z[/b]=[b]7[/b], stackpos=1} -- para onde o teleport levaráteleport = getThingfromPos(criaronde)if item.itemid == 1945 thendoTransformItem(item.uid,1946)createTP(criaronde,irpara)elseif item.itemid == 1946 thendoTransformItem(item.uid,1945)doRemoveItem(teleport.uid,1)endreturn 1end

 

.: Alterações necessárias:

.:. criar_onde => Posição de onde o magic forcefield (bolinha azul) será criada

.:. ir_para => Para onde o teleport leva

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::[/b]

Espero ter ajudado

FlW

CyA!

It's the hunger; the hunger for an alternative and the refusal to accept a life of unhappiness.


favorefty

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/10/05Posts: 82

Agora sim ^^

Valeu brother, AI LOVI IU

Abraços,

Favorefty

Ajudando a Organizar o Fórum.
Meu Fã ? use :)
favoreftyfansl7.jpg
Sou:
Mapper.gif
70%
ServerAdmin.gif
100%

Penny

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/12/05Posts: 3

Cara excelente ^^

Será q da pra libera o Paralyze System + Remove Paralyze ? Eh Super Importante... Vlws